import javax.swing.*;
import java.awt.*;

public class WordThread extends Thread {
    char word;
    JLabel com;

    WordThread(JLabel com) {
        this.com = com;
    }

    public void run() {
        while (true) {
            word = (char) (int) (Math.random() * 26 + 65);
            com.setText("" + word);
            try {
                sleep(2000);
            } catch (InterruptedException e) {
            }
        }
    }
}

